<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    用户名<input type="text" />
    <p></p>
    <script>
      let ipt = document.querySelector('input')
      let p = document.querySelector('p')

      function handle(data) {
        ipt.style.border = '1px solid #f00'
        p.innerHTML = data.data
      }

      ipt.onblur = function () {
        // 创建script标签
        let script = document.createElement('script')
        // 发送请求
        script.src = 'http://127.0.0.1:9527/jsonp-origin'
        //  标签上树
        document.body.appendChild(script)
      }
    </script>
  </body>
</html>
